package com.anhdt.model;

import com.anhdt.dao.UserDAO;
import com.anhdt.utils.VUtils;
import com.anhdt.vo.UserVO;
import java.sql.SQLException;

public class User {

    private static User user;

    private User() {
    }

    public static User getInstance() {
        if (user == null) {
            user = new User();
        }
        return user;
    }

    private final UserDAO userDAO = UserDAO.getInstance();

    public UserVO checkLogin(String username, String password) throws SQLException {
        return userDAO.getUser(username, VUtils.md5(password));
    }

}
